{% set page_toc = get_class_toc() %}

{% if pagename.startswith("api") or pagename.startswith("reference") %}

{%- if page_toc %}
<div class="tocsection onthispage pt-5 pb-3">
    <i class="fas fa-list"></i> {{ _("On this page") }}
</div>
{%- endif %}

<nav id="bd-toc-nav">
    <ul class="visible nav section-nav flex-column">
    <li class="toc-h1 nav-item toc-entry" style="font-weight: 400; margin-left: 1rem; margin-bottom: 5px;">
        {{page_toc.title}}
    </li>
    {% for item in page_toc.menu_items %}
        <li class="toc-h2 nav-item toc-entry">
            {{ item.title }}
        </li>
        {% for item2 in item.menu_items %}
        <li class="toc-h3 nav-item toc-entry">
            <a class="reference internal nav-link" href="{{ item2.link }}">{{ item2.title }}</a>
        </li>
    {% endfor %}
    {% endfor %}
    </ul>
</nav>

{%- endif %}
